Now that we have our teleporter going from pad A to pad B, let's go ahead and go from pad B to pad
C down here and then we'll put some music in the box too, so they can listen to it while they're standing
there.
So let's open up our teleporter script and then we'll get a variable for pad C because that's where
we want to go after pad B, Pad C equals script dot, parent, teleporter C, pad C, and we need two
more variables.
We need a D bounce flag can teleport and D bounces allow you to control how often something is going
to be used so we can teleport.
When this is true, we'll initialize it to true.
Then we're going to do a cooldown and we'll make that like 5 seconds because we're testing this out.
You're going to change this to whatever you want in the game.
You might want to cool off in that box for a while.
All right.
So down here, if we have a player, we're going to do our teleporting, right?
We're going to change our C frame to our humanoid route part.
We are also going to check right here to make sure can teleport is true.
So now these both have to be valid, has to be a player, can't be nil.
And then this has to be true.
It can't be false.
All right.
So when we teleport, we want to turn the can teleport to false.
So the first person that touches that pad A is going to go next person.
This is not going to work for them, Right.
Whoever registers the touch first.
And then what I'll do is I'll wait.
Right.
We're going to do a wait.
We'll do it the cooldown time, which is only 5 seconds for us.
Then we'll turn our can teleport back on to true.
And as somebody else comes through, it doesn't matter because we're on our way out.
Right?
So then what I'm going to do is I'm going to get this humanoid part part C brain thing, right?
And we'll just go ahead and change that to pad C.
Still want to keep this vector three though, because you don't want to teleport inside pad C on top,
Right on top.
Let's try it out and then we'll add some music.
Let's go into our teleporter.
Boom!
We're here.
We've got to wait 5 seconds.
One, two, three.
There we go.
All right, that's working pretty good.
Let's add some music.
All right?
So go ahead and stop this.
Let's go over to our game, my zombie game, and go to our toolbox.
Under Marketplace.
Go to audio and then type in elevator music.
I already typed it in and we'll hit search.
There is no elevator music.
Never fear.
Hit those three lines and then go ahead and click include Unverified Creators, which is most of the
creators.
So apply.
And then I'm going to use this one right here.
It's 31 seconds.
Let's try it out.
It's perfect.
All right.
Where do I want to put this?
If you really want to be a purist, I would put an invisible part right smack in the center here.
And that way you could keep your roll off pretty small so nobody could hear it outside.
But what I'm going to do is I'm going to hit the alt key and then hit that roof part.
Right?
The alt key allows you to select stuff inside your model so you can see we selected the roof.
I might change that name to to roof because I'm going to have music in it.
That way you can hear the music if you're standing on the roof, if you do the part in the center of
the room, you can make it so that you can only hear it in the room, which is be good for elevators.
Right?
So I'm going to do an insert, but there's an elevator music.
I might just change out the music.
Hit enter.
I'm going to go down here.
I'm going to turn Looped on.
So it's just going to keep looping and playing on.
So it's going to start playing when we start playing our game and then we could do volume and stuff
like that.
But I think we're all right.
What I want to do is I want to look for the max roll off distance.
I don't want to hear this on the ground.
I want it to be kind of contained in the box.
We're not really doing it inside the box because it's on the roof.
But let's just make that 20.
That's all right.
Because this is 20.
By 20, this is ten by ten.
You won't hear that music below this point.
Right?
Right about here.
Cool.
Let's try it.
Will run over.
I'm going to turn.
I'm going to make this go away.
Here we go.
Let's run over to our teleporter.
We need to get a zapping sound to.
Suede.
Now the 1002.
There we go.
I start counting late.
Nice.
All right, so the next video, we're going to do the cool down stuff for this, right?
We're going to we're going to make this go dull.
We're going to make a zapping sound, and then we're going to put a zapping sound from B to C to.